import request from '@/router/axios';

const customWebAPI = {
    getCustomWebData: '/api/app/worksheet/info/get',
    updateCustomWeb: '/api/app/worksheet/info/update'
}

  export function getCustomWebData (params) {
    return new Promise((resolve, reject) => {
      request({
        url: customWebAPI.getCustomWebData,
        method: 'get',
        params: params
      }).then(res => {
        if(res.status === 200 && res.data.code === 200){
          resolve(res.data.data)
        } else {
          reject(false)
        }
      })
    })
  }

  export function updateCustomWeb (params) {
    return new Promise((resolve, reject) => {
      request({
        url: customWebAPI.updateCustomWeb,
        method: 'post',
        data: params
      }).then(res => {
        if(res.status === 200 && res.data.code === 200){
          resolve(true)
        } else {
          reject(false)
        }
      })
    })
  }